﻿@model WaiGaoQiaoWeb.Models.WindowBusinessSummaryVM
@{
    ViewBag.Title = "WindowBusinessSummaryIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("dp")
    @Html.Js("datepicker")
    @Html.Css("EditForm")
    <script type="text/javascript">
        var mainheight = document.documentElement.clientHeight;
        var mainWidth = document.documentElement.clientWidth;
        $(document).ready(function () {
            var otherpm = $("#title").height() + $("#findDiv").height(); // 290;
            var gh = mainheight - otherpm - 60;
            var option = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("GetList")',
                colModel: [
                    { display: 'SN', name: 'SN', width: 60, sortable: false, align: 'left', hide: true, iskey: true },
                    { display: '窗口', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '早餐人次', width: 80, sortable: false, hide: false, align: 'left' },
			        { display: '早餐金额', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '中餐人次', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '中餐金额', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '晚餐人次', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '晚餐金额', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '夜餐人次', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '夜餐金额', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '合计人次', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '合计金额', width: 80, sortable: false, hide: false, align: 'left' }
				],
                singleselected: true,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpOptions: [10, 15, 20],
                showcheckbox: true,
                rowbinddata: true,
                query: $("#StartTime").val() + "," + $("#EndTime").val() + "," + $("#NodeID :selected").val()
            };
            $("#FundsOperatingList").flexigrid(option);
            function SelectClick() {
                option.query = $("#StartTime").val() + "," + $("#EndTime").val() + "," + $("#NodeID :selected").val();
                option.newp = 0;
                $("#FundsOperatingList").flexOptions(option).flexReload();
            }
            $("#btnQueryList").click(function () {
                SelectClick();
            });
            $("#StartTime").bind('keydown', function (e) {
                var key = e.which;
                if (key == 13) {
                    e.preventDefault();
                    SelectClick();
                }
            });
            $("#EndTime").bind('keydown', function (e) {
                var key = e.which;
                if (key == 13) {
                    e.preventDefault();
                    SelectClick();
                }
            });
            $("#NodeID").bind('keydown', function (e) {
                var key = e.which;
                if (key == 13) {
                    e.preventDefault();
                    SelectClick();
                }
            });
            $("#btnExport").click(function () {
                var starttime = $("#StartTime").val();
                var endtime = $("#EndTime").val();
                var nodeid = $("#NodeID :selected").val();
                var nodename = $("#NodeID :selected").text();
                var strulr = "ReportOut?st=" + starttime + "&et=" + endtime + "&nodeid=" + nodeid + "&nodename=" + nodename;
                var subwin = window.open(strulr, "", "menubar=no,toolbar=no,status=no,resizable=no,scrollbars=yes");
                subwin.moveTo(0, 0);
                subwin.resizeTo(window.screen.availWidth, window.screen.availHeight);
                return false;
            });
        });
    </script>
}
<div id="container">
    <div id="mainContent">
        <div id="title" class="title">
            窗口营业汇总表</div>
        <div id="findDiv">
            <table>
                <tr>
                    <td style="text-align: right; width: 80px;">
                        开始时间：
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.StartTime, new { @ReadOnly = true, @style = "width:140px;", @class = "Wdate", onfocus = "WdatePicker({vel:'C1SignInTime.BeginTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        结束时间：
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.EndTime, new { @ReadOnly = true, @style = "width:140px;", @class = "Wdate", onfocus = "WdatePicker({vel:'C1SignInTime.BeginTime',dateFmt:'yyyy-MM-dd HH:mm:ss'})" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        消费组：
                    </td>
                    <td>
                        @Html.DropDownListFor(model => model.NodeID,
                                   ViewData["Node"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:150px; height:22px; font-size:13px;" })
                    </td>
                    <td>
                        <a id="btnQueryList" class="button" href="javascript:void(0);"><span>查 询</span></a>
                        <a id="btnExport" class="button" href="javascript:void(0);"><span>导 出</span></a>
                    </td>
                </tr>
            </table>
        </div>
        <table id="FundsOperatingList" style="display: none;">
        </table>
    </div>
</div>
